<template>
    <div class="classify-detail">
        <double-goods :content='realData'></double-goods>
        <div class="back-before">
            <div class="back-btn" @click='backBefore'>
                <span>返回上一页</span>
            </div>
        </div>
    </div>
</template>

<script>
import virtualData from './virtual'
import doubleGoods from '../../public/doubleGoods'

export default {
    name:'classifyDetail',
    data(){
        return {
            virtual:virtualData,
            realData:[]
        }
    },
    methods:{
        backBefore(){
            this.$router.push('/container/classify')
        },
        getGoodsList(){
            let that = this;
            let token = localStorage.getItem('token');
            let id = that.$route.query.id;
            that.$ajax(that, 'get', that.$api.classifyGoods+id, null, token, function(res){
                console.log(res);
                if(res.data['error_code'] == 0){
                    that.realData = res.data.msg;
                    that.transferUrl(that.realData);
                }else{
                    that.realData = [];
                }
            })
        }
    },
    mounted(){
        console.log(this.$route);
        this.getGoodsList();
    },
    activated(){
        this.getGoodsList();
    },
    components:{
        doubleGoods
    }
}
</script>

<style lang='less'>
@rem:100rem;

.classify-detail{
    width: 750/@rem;
    margin-top: 98/@rem;
    margin-bottom: 96/@rem;
    background: #ffffff;
    .back-before{
        width: 100%;
        height: 178/@rem;
        display: flex;
        align-items: center;
        justify-content: center;
        .back-btn{
            width: 480/@rem;
            height: 80/@rem;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8/@rem;
	        border: solid 1px #dfdfdf;
        }
        .back-btn:active{
            background: #f2f2f2;
        }
    }
}
</style>
